package com.example.demo.exception;

import com.example.demo.pojo.ResultCode;

/**
 * @Description:
 * @Auther:ccc
 * @Date:2022/11/12 20:13
 */
public class BusinessException extends RuntimeException {

    private String errCode;
    private String errMsg;


    public BusinessException(String errCode, String message) {
        this.errMsg = message;
        this.errCode = errCode;
    }

    public BusinessException(ResultCode resultCode) {
        this.errCode = resultCode.getCode();
        this.errMsg = resultCode.getMsg();
    }

    public String getErrCode() {
        return errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }
}
